Repository navigation
fix: write tabs session file atomically to survive unclean shutdown - #2356
Open
jorgeecardona wants to merge 1 commit into
Open
jorgeecardona wants to merge 1 commit into
jorgeecardona wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Temporary-path construction breaks custom filenames containing directory components, and the test does not exercise interrupted writes.
2 open findings
What changed in this PR
Makes tab-session persistence crash-safe through atomic replacement and filesystem syncing.
Changes:
- Writes sessions through a temporary file and atomically replaces the destination.
- Adds atomic-save coverage and a release note.
| File | Description |
|---|---|
guake/guake_app.py |
Implements atomic, durable session saving. |
guake/tests/test_guake.py |
Tests the new save path. |
releasenotes/notes/crash-safe-save-tabs-adf00755bead6ea5.yaml |
Documents the fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
save_tabs truncated session.json in place, so a crash or power loss mid-write left a half-written file that restore_tabs discarded as broken. Write to a sibling .tmp file, flush and fsync it, os.replace it onto session.json, then fsync the directory so the rename is durable.
jorgeecardona
force-pushed
the
crash-safe-save-tabs
branch
from
October 11, 2026 07:49
e471f88 to
a09fdd5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


A crash or power loss while saving tabs could leave a half-written
session.json, and restore then discarded it.session.json.tmp, fsync,os.replace, then fsync the directory.